﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="buddylist.aspx.cs" Inherits="IM_buddylist" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Buddy List</title>
    <link href="../CSS/IM.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/screen.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/jquery.treeview.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager2" runat="server">
        <Services>
            <asp:ServiceReference Path="~/Controls/chatProg.asmx" />
        </Services>
        <Scripts>
            <asp:ScriptReference Path="~/js/jquery-1.2.6.min.js" ScriptMode="Release" />
            <asp:ScriptReference Path="~/js/jquery-timer.js" ScriptMode="Release" />
            <asp:ScriptReference Path="~/js/ChatBuddyList.js" ScriptMode="Release" />
            <asp:ScriptReference Path="~/js/utilities.js" ScriptMode="Release" />
            <asp:ScriptReference Path="~/js/jquery.treeview.js" />
        </Scripts>
    </asp:ScriptManager>
    <div class="divBuddyListIcons">
        <asp:HyperLink ID="hlAddBuddy" runat="server"><img src="../images/imaddbuddy.png" /></asp:HyperLink>
        <asp:HyperLink ID="hlRemoveBuddy" runat="server"><img src="../images/imremovebuddy.png" /></asp:HyperLink>
        <asp:HyperLink ID="hlJoinRoom" runat="server"><img src="../images/IMjoinroom.png" /></asp:HyperLink>
        <asp:HyperLink ID="hlIMSettings" runat="server"><img src="../images/IMsettings.png" /></asp:HyperLink><asp:Image
            ID="imgBuddyIcon" CssClass="divBuddyIconList" runat="server" Height="40px" />
        <cc1:CollapsiblePanelExtender ID="cpeAddBuddy" TargetControlID="pnlAddBuddy" CollapsedSize="0"
            ExpandedSize="150" Collapsed="true" ExpandControlID="hlAddBuddy" CollapseControlID="hlAddBuddy"
            runat="server" ScrollContents="false" SuppressPostBack="true">
        </cc1:CollapsiblePanelExtender>
        <cc1:CollapsiblePanelExtender ID="cpeRemoveBuddy" TargetControlID="pnlRemoveBuddy"
            CollapsedSize="0" ExpandedSize="120" Collapsed="true" ExpandControlID="hlRemoveBuddy"
            CollapseControlID="hlRemoveBuddy" runat="server" ScrollContents="false" SuppressPostBack="true">
        </cc1:CollapsiblePanelExtender>
        <cc1:CollapsiblePanelExtender ID="cpeGroupChat" TargetControlID="pnlGroupChat" CollapsedSize="0"
            ExpandedSize="230" Collapsed="true" ExpandControlID="hlJoinRoom" CollapseControlID="hlJoinRoom"
            runat="server" ScrollContents="false" SuppressPostBack="true">
        </cc1:CollapsiblePanelExtender>
        <cc1:CollapsiblePanelExtender ID="cpeSettings" TargetControlID="pblSettings" CollapsedSize="0"
            ExpandedSize="270" Collapsed="true" ExpandControlID="hlIMSettings" CollapseControlID="hlIMSettings"
            runat="server" ScrollContents="false" SuppressPostBack="true">
        </cc1:CollapsiblePanelExtender>
        <asp:Panel ID="pnlAddBuddy" CssClass="pnlblCollapsedPanels" runat="server">
            <div class="divblTitle">
                Add a Buddy</div>
            <div class="divDescription">
                Please enter the name of the user you would like to add to your buddy list.
                <asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="lblWarning"></asp:Label></div>
            <div>
                <table>
                    <tr>
                        <td>
                            Username:
                        </td>
                        <td>
                            <asp:TextBox ID="tbAddBuddyUserName" CssClass="tbblBuddyLists" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                                ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbAddBuddyUserName"
                                ValidationGroup="AddBuddy" ErrorMessage="RequiredFieldValidator">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Add to Group:
                        </td>
                        <td>
                            <asp:TextBox ID="tbAddBuddyGroupName" CssClass="tbblBuddyLists" runat="server" Text="Friends"></asp:TextBox><asp:RequiredFieldValidator
                                ID="RequiredFieldValidator2" runat="server" ErrorMessage="RequiredFieldValidator"
                                ValidationGroup="AddBuddy" ControlToValidate="tbAddBuddyGroupName">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                </table>
            </div>
            <div>
                <asp:Button ID="btnAddBuddy" runat="server" CssClass="btnButtons" ValidationGroup="AddBuddy"
                    Text="Add" OnClick="btnAddBuddy_Click" /><%--<asp:Button ID="btnCancelAdd" CssClass="btnButtons"
                        runat="server" Text="Cancel" />--%>
            </div>
        </asp:Panel>
        <asp:Panel ID="pnlRemoveBuddy" CssClass="pnlblCollapsedPanels" runat="server">
            <div class="divblTitle">
                Remove a Buddy</div>
            <div class="divDescription">
                Please select the name of the buddy you want to remove
                <asp:Label ID="lblWarning2" runat="server" Visible="false" CssClass="lblWarning"></asp:Label></div>
            <div>
                <table>
                    <tr>
                        <td>
                            Username:
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlRemoveBuddy" CssClass="tbblBuddyLists" runat="server" AppendDataBoundItems="true">
                                <asp:ListItem Value="" Text=""></asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddlRemoveBuddy"
                                ValidationGroup="RemoveBuddy" ErrorMessage="RequiredFieldValidator">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                </table>
            </div>
            <div>
                <asp:Button ID="btnRemoveBuddy" runat="server" CssClass="btnButtons" ValidationGroup="RemoveBuddy"
                    Text="Remove" OnClick="btnRemoveBuddy_Click" /><%--<asp:Button ID="btnCancelRemove" CssClass="btnButtons"
                        runat="server" Text="Cancel" />--%>
            </div>
        </asp:Panel>
        <asp:Panel ID="pnlGroupChat" CssClass="pnlblCollapsedPanels" runat="server">
            <div class="divblTitle">
                Join a ChatRoom</div>
            <div class="divDescription">
                Please enter the name of the room you would like to join.
                <asp:Label ID="Label1" runat="server" Visible="false" CssClass="lblWarning"></asp:Label></div>
            <div>
                <ul class="ulJoinChat">
                    <li class="liJoinChat">Room Name:</li>
                    <li class="liJoinChat">
                        <asp:TextBox ID="txtbxRoomName" CssClass="tbJoinChat" runat="server"></asp:TextBox></li>
                    <li class="liJoinChat">
                        <asp:ListBox ID="lbRoomNames" DataValueField="room_name" DataTextField="room_name"
                            CssClass="tbJoinChat" Rows="5" runat="server"></asp:ListBox>
                    </li>
                </ul>
            </div>
            <div>
                <a id="aJoinRoom" runat="server" class="aJoinRoomButton">Join Room</a>
            </div>
        </asp:Panel>
        <asp:Panel ID="pblSettings" CssClass="pnlblCollapsedPanels" runat="server">
            <div class="divblTitle">
                Settings</div>
            <div class="divDescription">
                From the settings, you can change your profile information or your buddy icon.
                <asp:Label ID="lblSettings" runat="server" Visible="false" CssClass="lblWarning"></asp:Label></div>
            <cc1:TabContainer ID="TabContainer1" runat="server" CssClass="ajax__tab_MyProfile-theme">
                <cc1:TabPanel HeaderText="Icon" ID="pnlIcon" runat="server">
                    <ContentTemplate>
                        <div>
                            <table>
                                <tr>
                                    <td>
                                        To change your buddy icon, select the image you'd like to use then click 'Change'.
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input id="inBuddyIcon" class="inputSaveBuddyIcon" runat="server" type="file" /><asp:RequiredFieldValidator
                                            ID="RequiredFieldValidator4" runat="server" ErrorMessage="RequiredFieldValidator"
                                            ValidationGroup="SaveIcon" ControlToValidate="inBuddyIcon">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div>
                            <asp:Button ID="btnSaveIcon" runat="server" CssClass="btnButtons" ValidationGroup="SaveIcon"
                                Text="Change" OnClick="btnSaveIcon_Click" /><%--<asp:Button ID="btnCancelRemove" CssClass="btnButtons"
                        runat="server" Text="Cancel" />--%>
                        </div>
                    </ContentTemplate>
                </cc1:TabPanel>
                <cc1:TabPanel ID="pnlProfile" HeaderText="Profile" runat="server">
                    <ContentTemplate>
                        <div>
                            <table>
                                <tr>
                                    <td>
                                        To change your buddy profile, just adjust is to how you want it below and then click
                                        'Change'.
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:TextBox ID="tbBuddyProfile" Rows="5" CssClass="tbBuddyProfile" TextMode="MultiLine"
                                            runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div>
                            <asp:Button ID="btnSaveProfile" runat="server" CssClass="btnButtons" Text="Change"
                                OnClick="btnSaveProfile_Click" />
                        </div>
                    </ContentTemplate>
                </cc1:TabPanel>
            </cc1:TabContainer>
        </asp:Panel>
    </div>
    <div class="divBuddyList">
        <ul class="ulBuddyListGroups" id="ulTop">
            <li class="liBuddyListGroups open" id="liFirends" visible="false" runat="server">Friends
                <ul id="ulFriends" class="ulBuddyListUsers">
                    <asp:Repeater ID="rptFriends" runat="server" OnItemDataBound="rptOnlineUsers_ItemDataBound">
                        <ItemTemplate>
                            <li class="liBuddyListUsers">
                                <img src="../images/IMon.png" /><a id="aUserLink" runat="server">
                                    <asp:Label ID="lblUserName" runat="server" Text='<%# Bind("UserName") %>'></asp:Label></a>
                                <%--<asp:LinkButton ID="lbUserName" runat="server" Text='<%# Bind("UserName") %>'></asp:LinkButton>--%>
                            </li>
                        </ItemTemplate>
                    </asp:Repeater>
                </ul>
            </li>
            <li class="liBuddyListGroups open" id="liOnline">Online Users
                <ul id="ulOnline" class="ulBuddyListUsers">
                    <asp:Repeater ID="rptOnlineUsers" runat="server" OnItemDataBound="rptOnlineUsers_ItemDataBound">
                        <ItemTemplate>
                            <li class="liBuddyListUsers">
                                <img src="../images/IMon.png" /><a id="aUserLink" runat="server">
                                    <asp:Label ID="lblUserName" runat="server" Text='<%# Bind("UserName") %>'></asp:Label></a>
                                <%--<asp:LinkButton ID="lbUserName" runat="server" Text='<%# Bind("UserName") %>'></asp:LinkButton>--%>
                            </li>
                        </ItemTemplate>
                    </asp:Repeater>
                </ul>
            </li>
            <li class="liBuddyListGroups">Offline Users
                <ul id="ulOffline" class="ulBuddyListUsers">
                    <asp:Repeater ID="rptOfflineUsers" runat="server" OnItemDataBound="rptOfflineUsers_ItemDataBound">
                        <ItemTemplate>
                            <li class="liBuddyListUsers">
                                <img src="../images/IMoff.png" /><a id="aUserLink" runat="server">
                                    <asp:Label ID="lblUserName" runat="server" Text='<%# Bind("UserName") %>'></asp:Label></a>
                                <%--<asp:LinkButton ID="lbUserName" runat="server" Text='<%# Bind("UserName") %>'></asp:LinkButton>--%>
                            </li>
                        </ItemTemplate>
                    </asp:Repeater>
                </ul>
            </li>
        </ul>
    </div>

    <script type="text/javascript">
        $(document).ready(function() {

            // first example
            $("#ulTop").treeview({
                persist: "location",
                collapsed: true,
                unique: true
            });
        });
    </script>
<script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
    try {
        var pageTracker = _gat._getTracker("UA-6812912-1");
        pageTracker._trackPageview();
    } catch (err) { }</script>
    </form>
</body>
</html>
